/*    */ package com.chw.filter;
/*    */ 
/*    */ import java.io.IOException;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import org.apache.commons.lang3.StringUtils;
/*    */ import org.jasig.cas.client.authentication.AuthenticationRedirectStrategy;
/*    */ 
/*    */ public final class CustomAuthenticationRedirectStrategy
/*    */   implements AuthenticationRedirectStrategy
/*    */ {
/*    */   public void redirect(HttpServletRequest request, HttpServletResponse response, String potentialRedirectUrl)
/*    */     throws IOException
/*    */   {
/* 39 */     String requestType = request.getHeader("X-Requested-With");
/* 40 */     if ((StringUtils.isNotBlank(requestType)) && ("XMLHttpRequest".equals(requestType)))
/* 41 */       response.setStatus(401);
/*    */     else
/* 43 */       response.sendRedirect(potentialRedirectUrl);
/*    */   }
/*    */ }

/* Location:           E:\chenya\2017 4-21\com.chw\filter\
 * Qualified Name:     com.chw.filter.CustomAuthenticationRedirectStrategy
 * JD-Core Version:    0.6.0
 */